package com.b2j.language;

import com.b2j.base.Lexema;
import com.b2j.base.MainTools;
import com.b2j.base.Routine;
import com.b2j.base.Token;

public class Case extends Routine {

	@Override
	public String generate(Lexema lexema) {
		
		String line = "case ";
			
		// Process the IF body 'if(expresion)'

		line = line + MainTools.tools.processCodeUntil(lexema, Token.COLON);
		line = line +  ":{\n";

		// Process the code inside the block of IF
		line = line + MainTools.tools.processCodeUntil(lexema, Token.END);
		line = line + "break;\n}\n";	
		
		return line;
	}

}
